//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Policy Injection Application Block
//===============================================================================

using System;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using EntLibContrib.PolicyInjection.CallHandlers.Configuration.Design.Properties;

namespace EntLibContrib.PolicyInjection.CallHandlers.Configuration.Design
{
	/// <summary>
	/// Register node maps for the call handler nodes.
	/// </summary>
	public class PolicyInjectionCallHandlersNodeMapRegistrar : NodeMapRegistrar
	{
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="PolicyInjectionCallHandlersNodeMapRegistrar"/> class.
		/// </summary>
		/// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		public PolicyInjectionCallHandlersNodeMapRegistrar(IServiceProvider serviceProvider)
			: base(serviceProvider)
		{ }
		#endregion

		#region Construction
		/// <summary>
		/// Registers the node maps.
		/// </summary>
		public override void Register()
		{
			base.AddMultipleNodeMap(Resources.CursorCallHandlerNodeName,
															typeof(CursorCallHandlerNode),
															typeof(CursorCallHandlerData));

			base.AddMultipleNodeMap(Resources.OneWayCallHandlerNodeName,
															typeof(OneWayCallHandlerNode),
															typeof(OneWayCallHandlerData));

			base.AddMultipleNodeMap(Resources.SynchronizedCallHandlerNodeName,
															typeof(SynchronizedCallHandlerNode),
															typeof(SynchronizedCallHandlerData));

			base.AddMultipleNodeMap(Resources.ThreadSafeCallHandlerNodeName,
															typeof(ThreadSafeCallHandlerNode),
															typeof(ThreadSafeCallHandlerData));

			base.AddMultipleNodeMap(Resources.TransactionScopeCallHandlerNodeName,
															typeof(TransactionScopeCallHandlerNode),
															typeof(TransactionScopeCallHandlerData));
		}
		#endregion
	}
}